package com.mrjy.schooldiy.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.common.entity.DiyLableInfo;
import com.mrjy.schooldiy.bo.IDiyLableInfoBo;

@Controller
@RequestMapping("/schooldiy/lable")
public class DiyLableInfoController {
	@Resource
	private IDiyLableInfoBo diyLableInfoBo;
	/*
	 * 开发后台查询所以标签
	 * */
	@RequestMapping(value="/back/lables",method = RequestMethod.GET)
	@ResponseBody
	public Object queryPageListForBack(DiyLableInfo info,HttpSession session){
		return diyLableInfoBo.queryPageListForBack(info,session);
	}
	@RequestMapping(value ="/usable-lables",method = RequestMethod.GET)
	@ResponseBody
	public Object queryCanUseList(DiyLableInfo info){
		return diyLableInfoBo.queryCanUseList(info);
	}
	@RequestMapping(value = "/name-lables",method = RequestMethod.GET)
	@ResponseBody
	public Object queryListByName(DiyLableInfo dInfo){
		return diyLableInfoBo.queryListByName(dInfo);
	}
	
	@RequestMapping(value = "/disableflag-lables" , method = RequestMethod.POST)
	@ResponseBody
	public Object updateDisableFlag(DiyLableInfo dInfo) {	
		return diyLableInfoBo.txUpdateDisableFlag(dInfo);
    }
	@RequestMapping(value = "/lables",method = RequestMethod.POST)
	@ResponseBody
	public Object add(DiyLableInfo dInfo) {	
		return diyLableInfoBo.txAdd(dInfo);
    }
	
	@RequestMapping(value = "/lables/{id}",method = RequestMethod.POST)
	@ResponseBody
	public Object edit(DiyLableInfo dInfo) {	
		return diyLableInfoBo.txEdit(dInfo);
    }
}
